<?php

class AppModel extends Model {

    function verifies($data, $field=null) {

        $keys = array_keys($data);
        $key = $keys[0];
        if(!is_string($field)) {
            if( ($pos = strpos($key, "_verification")) === FALSE ) {
                return FALSE;
            }
            $field = substr($key, 0, $pos);
        }
        return ($data[$key] == $this->data[$this->name][$field]);
    }
    
}
?>